I would like to do the following:
- read multiple ascii files (*.txt) into memory. I need to skip the first 4 lines of each file. The integer values in these files are written unstructured and continuous line after line. The number of values per line can vary and is not important.
- Once I have read all data in memory I need to write it to one single file and one value per line, i.e. one column. Before writing the values, I need to write 3 lines of header.
I need to have this as script which I can call from the terminal (Bash). I appreciate your help!
Your question is very vague, but I came up with this:
These are my assumptions:
f1,f2,f3andoutfilepath, then the values inf1appear first inoutfilepathand the values inf2appear second inoutfilepath, etcHere is a function that does what you want under these assumptions:
Hope this helps