Wednesday, July 12, 2017

Rename a file and duplicate a file


7/12/17:
Make a duplicate file using putty command
cp <file_name1> <file_name2>--cp to copy   ---working
mv <file_name1> <file_name2> --mv to rename -- -working



Command to unzip a file on cluster


- 7/12/17
how to zip compress and unzip extract files
solution: unzip <file.zip>  --- working

Wednesday, July 5, 2017

Search History and Resolution


Python:
- newline is an invalid argument for open function in python
- Cannot concatenate 'str' and 'int' objects error in python
http://stackoverflow.com/questions/11844072/python-typeerror-cannot-concatenate-str-and-int-objects
- skip first iteration in for loop in python
http://stackoverflow.com/questions/10079216/skip-first-entry-in-for-loop-in-python

- return_opener.open(url,data,timeout) bad request error in python
- urrlib2 inside a loop
- urllib2 code has to be in try block else the data is not getting parameterized.
- Issue is with parameterizing json request. If everything is hardcode script is working fine.
urllib2.
- can string be in single quote in python?
Yes it can be single or double quote, but most preferrably use double quotes.
- python is case sensitive?---yes it is
- https://stackoverflow.com/questions/13940272/python-json-loads-returns-items-prefixing-with-u
- difference between double quote and single quote in python
- Handling key error in python

Tuesday, July 4, 2017

How to find whether text exist in a file

grep -r -e 'text' -e 'text1' file_name.* > file_name2

-- here grep will look for text and text1 in file_name and store in file_name2