I want the final file as:
The animal values will be taken from file one and used as reference.
File2 is all messed up and the only real separator is |.
Thanks.
Moderator's Comments:
Please use CODE tags when displaying sample input, output, and code segments as required by forum rules.
Let's start with the basics:
What have you tried to solve this problem on your own?
What operating system are you using?
What shell are you using?
Then we can move on to the thread specifics:
What is the field separator in File1? I assume it isn't a <space>, or do you disallow animals like mountain lion, Asian elephant, African elephant, eastern diamondback rattlesnake, western diamondback rattlesnake, timber rattlesnake, etc. from your representable data?
How is one supposed to determine what number is to be associated with an animal? If we ignore <newline>s as field and/or record separators, you still have most numbers coming from the text somewhere between the 2nd and 3rd <vertical-bar> character following the field that contains the animal name surrounded by <space>s. Sometimes there are three <vertical-bar>s between the string containing the animal and the string containing the number said should appear in the output.
i have a script, whcih takes values from a file and assign it to one variable. this text value contains name of few object. value contains line by lie. i.e. one after another.
when i am assaign the value of this text file to a variable, it accept the value as one liner instead of one by one.... (3 Replies)
i have an input file of XML type with data like
<nx-charging:additional-parameter name="NX_INTERNATIONALIZED_CLID" value="919427960829"/><nx-charging:finalStatus>RESPONSE , Not/Applicable , OK</nx-charging:finalStatus></nx-charging:process>
i want to extract data such that i get the output... (3 Replies)
Dear Guyz:)
I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z).
I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Hello People,
I have an xml file from which I need to extract the values of the parameters using UNIX shell commands.
Ex : Input is like :
<Name>Roger</Name>
or
<Address>MI</Address>
I need the output as just :
Roger
or
MI
with the tags removed.
Please help. (1 Reply)
Dear All,
i am new to shell scripting, I am working on embedded system based on linux.I am supposed to the read the configuration file and edit another file.
presently I would like to read from the configuration file.It would be having values file one below.
There is chance of entering... (6 Replies)
I would like to read value after $ symbol from a file.
For eg
a file will be having the following lines.
5,$0,-32768p,32767p,$400014f8,1,,
5,$0,0,0,$400008ce,1,,
5,$0,0,0,$400008d0,1,,
i would like to read 400014f8 then 400014f8 and similar all the value after $ symbol.Can any one help... (1 Reply)
Hi,
Taking sum up all values inside the file by using the below command:
paste -sd+ filenmae | bc
Getting some error like "0705-001: building space exceeded on line1 stdin"
The original data looks like
SPACE SPACE SPACE 0.123 JOBNAME1
SPACE SPACE 20.325 JOBNAME2
SPACE SPACE... (2 Replies)
How do I extract values in a few columns in a row of a fixed length file?
If there are 8 columns and I need to extract values of 2nd,4th and 6 th columns, how do i do that? I used cut command, this I used only for one column. How do I do it more than one column?
The below command will give... (1 Reply)
Hi,
Please help to fetch the values for a key from below data format in linux.
Sample Input Data Format
11055005|PurchaseCondition|GiftQuantity|1
11055005|PurchaseCondition|MinimumPurchase|400
11055005|GiftCatalogEntryIdentifier|Id|207328014
11429510|PurchaseCondition|GiftQuantity|1... (2 Replies)
Hello,
I'm new to scripting and I need to write a bash script. Here is example of file on which I'm working:
0.3092381 0.3262799 0.3425480 0.3578379 0.3719490
0.3846908 0.3958855 0.4053738 0.4130160 0.4186991
0.4223357 0.4238688 ... (14 Replies)