Sponsored Content
Top Forums Shell Programming and Scripting Extract header data from one file and combine it with data from another file Post 302758611 by Don Cragun on Sunday 20th of January 2013 08:50:39 AM
Old 01-20-2013
Quote:
Originally Posted by nex_asp
Code:
gsub(/]r/, "")

Sir I didn't find any changes from this sir
Sorry, the /]r/ should have been /\r/. I don't have time to work out what you need for FS and OFS; you might try just removing the place where you set FS; the default value may work with your latest input file.

The key point is that you need to tailor your script to match your input files AND YOU DO NOT HAVE A CONSISTENT INPUT FILE FORMAT.

When you tell us to come up with a solution for input files that have one or more tabs as field separators and no carriage returns in the file, you got a solution that worked for files in that format. Now you give us a pair of input files with lots of spaces as field separators and carriage returns. It is no surprise that the previous solution doesn't work with files that have a completely different input format.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

to find header in Mp3 file and retrieve data

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)
Discussion started by: shashi
2 Replies

2. Shell Programming and Scripting

insert a header in a huge data file without using an intermediate file

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)
Discussion started by: deepaktanna
10 Replies

3. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

4. Shell Programming and Scripting

Extract specific content from data and rename its header problem asking

Input file 1: >pattern_5 GAATTCGTTCATGTAGGTTGASDASFGDSGRTYRYGHDGSDFGSDGGDSGSDGSDFGSDF ATTTAATTATGATTCATACGTCATATGTTATTATTCAATCGTATAAAATTATGTGACCTT SDFSDGSDFKSDAFLKJASLFJASKLFSJAKJFHASJKFHASJKFHASJKFHSJAKFHAW >pattern_1 AAGTCTTAAGATATCACCGTCGATTAGGTTTATACAGCTTTTGTGTTATTTAAATTTGAC... (10 Replies)
Discussion started by: patrick87
10 Replies

5. Shell Programming and Scripting

Extract data from an XML file & write into a CSV file

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)
Discussion started by: ss_ss
2 Replies

6. Shell Programming and Scripting

get data from files combine them to a file

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)
Discussion started by: gc_sw
4 Replies

7. Shell Programming and Scripting

Extract data from XML file and write in CSV file

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)
Discussion started by: mohan sharma
3 Replies

8. Shell Programming and Scripting

How to combine data from 2 file ? How to print ?

Dear friends, I am just trying to print data from 2 file,namely file_1.txt and file_1.dat (specific column of ROW 1) file_1.txt 12 13 14 15 99 AMC 69 36 89 12 13 14 15 99 AMC 69 84 -12 12 13 14 ... (6 Replies)
Discussion started by: nex_asp
6 Replies

9. Shell Programming and Scripting

Combine data out of 3 files into one new file

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)
Discussion started by: MyMemberName
5 Replies

10. Shell Programming and Scripting

Bash to verify and validate file header and data type

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)
Discussion started by: cmccabe
6 Replies
bamg(1rheolef)							    rheolef-6.1 						    bamg(1rheolef)

NAME
bamg - bidimensional anisotropic mesh generator SYNOPSIS
bamg options -g input[.bamgcad] -o ouput[.bamg] EXAMPLE
bamg -g toto.bamgcad -o toto.bamg OUTLINE OF THE COMMANDS
This software can create a mesh from a geometry adapt a mesh from a background mesh using a metric or solution file do smoothing to make quadrilaterals and to split internal edge with 2 boundary vertices in an existing mesh (in this case the metric is use to change the definition of the element's quality). construct just a metric file, if you have an other mesher do the P1 interpolation of the solution on another mesh: CREATE A MESH FROM A GEOMETRY
input file with -g filename (file type DB mesh). output file arguments -oxxxx filename where xxxx is the type of output file (see below for more details). smoothing, quad, utility and other parameters. In addition, metric specication may be prescribed with the help of -M filename argument (file type Metric). All the options are described below. ADAPT A MESH FROM A BACKGROUND MESH USING A METRIC OR SOLUTION FILE
input files -b filename where the suffixe of the file define the type of the file `.amdba', `.am_fmt', `.am', `.ftq', `.nopo' and other- wise the file is a BD mesh file. input `-M filename' (file type Metric) or -MBB filename or -Mbb filename (solution file type BB or bb). metric control parameters, -err val, -errg val,.... output file arguments reqired interpolation, smoothing, quad, utility parameter, and other parameter do smoothing, to make quadrilaterals: and to split internal edge with 2 boundary vertices in an existing mesh (in this case the metric is use to change the definition of the element's quality). input files -r filename(file type DB mesh). -M filename (file type Metric). output file -o filename (file type DB mesh). some other parameter: @table @code -thetaquad val: to create quad with 2 triangles -2: to create the submesh with mesh size h = h/2 -2q: to split all triangles in 3 quad. and to split all quad. in 4 quad. -NbSmooth ival: to change the number of smoothing iteration (3 by default if the metric eld is set with arguments : -M or -Mbb, 0 otherwise. ... @end table construct just a metric file, if you have an other mesher: input files -r filename (file type DB mesh). --Mbb filename or -MBB filename + all the arguments of the metric construction output file -oM filename (file type Metric). do the P1 interpolation of the solution on another mesh: input files -r filename (file type DB mesh). --rBB filename or -rbb filename output file -wBB filename or -wbb filename METRIC COMPUTATIOB OPTIONS
These options are relevant when computing a metric from a scalar field provided in a .bb file. Notice that, when providing a tensor metric in the .bb file, the metric computation is not performed and these options are not relevent. -RelError compute the metric with a relative error. This is the default. -CutOff float the cut-off value used for the relative error criteria. Default value is 1e-5. -AbsError compute the metric with a relative error rheolef-6.1 rheolef-6.1 bamg(1rheolef)
All times are GMT -4. The time now is 04:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy