I tried your script with new file its reading header file as well as main file, I am happy with your solution
How do I save it as file
How to give command..
Hi.
How do you save what as a file? It isn't clear to what "it" refers in you question?
If you mean that you want to save the output produced by the script for all input files as a single output file try:
If you mean that you want the output produced by each set of input files to be stored in different output files, we can modify the script to take sets of three files (header file, main file, and output file) as operands.
If you need this in a hurry (as indicated by the three private messages you sent me ), you need to find someone else to help you. I just found out that I'm going to be tied up most of the rest of this weekend and at least until Wednesday afternoon next week.
I did look at your data enough to know that one of your problems is that the files you attached to message #10 in this thread are all terminated by carriage-return and newline characters instead of just a newline character.
that may get rid of the carriage return characters that are causing the latitude and longitude data to overwrite earlier fields in the output.
Another significant change is that in your first main.txt file, you had tabs separating fields. In your new main.txt file, there are no tab characters so all of your input lines in that file probably have only one field when you set FS to "\t\t".
And, as Don Cragun stated, your files are contaminated with windows style characters, repeatedly. Why don't you clean them before working on them or, even more important, posting them here? And, see same link, post consistent samples.
' I tried to make pure tab separated from this but still having problem, I understood what you said, before using unix what I need to do, that cleaning part is complex for me.. can you please tell, how you clean windows style char
---------- Post updated at 05:48 AM ---------- Previous update was at 05:25 AM ----------
sometimes I use this command to convert dos to unix, but this I won't trust because sometimes it results wrong..
if any modification I have to do means please tell me..
The below bash is a file validation check executed that will verify the correct header count of 10 and the correct data type in each field of the tab-delimited file. The key has the data type of each field in it. My real data has 58 headers in it but only the header and next row need to be... (6 Replies)
Hi,
How can I combine the data of of three files into one new file?
I try to give as much informations as possible.
The three existing files are called file1 file2 and file3
the new file should named output_combined.
The size of the files will be around 900 words/lines each .. but always... (5 Replies)
Hi friend i have input as following XML file
<?xml version="1.0"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02">
<BkToCstmrDbtCdtNtfctn>
<GrpHdr><MsgId>LBP-RDJ-TE000000-130042430010001001</MsgId><CreDtTm>2013-01-04T03:21:30</CreDtTm></GrpHdr>... (3 Replies)
hi people;
this is my file1.txt:192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
...
this is my file2.txt:portnames
usernames
maxusercap
...
i want to write to file3.txt:l ./getports 192.168.1.1 'get all;l+;get . portnames;l-'
l ./getports 192.168.1.1 'get all;l+;get . usernames;l-'... (4 Replies)
Hi All,
I am having an XML tag like:
<detail sim_ser_no_1="898407109001000090"
imsi_1="452070001000090">
<security>ADM1=????</security>
<security>PIN1=????</security>
<security>PIN2=????</security>
... (2 Replies)
I have a file with data extracted, and need to insert a header with a constant string, say: H|PayerDataExtract
if i use sed, i have to redirect the output to a seperate file like
sed ' sed commands' ExtractDataFile.dat > ExtractDataFileWithHeader.dat
the same is true for awk
and... (10 Replies)
hi all,
In an mp3 file , data is arranged in sequence of header and data ,how to retrieve data between two headers. Is the data between two headers fixed? because as per theory it says 1152 samples will be there , but dont knw how many bits one sample correspond to?
it would help if any c... (2 Replies)