I have 2 requirements on replacing fields of text files:
I have lot of data with contents like below: Requirement-1:
The digit after 0 should always be changed to 1 Requirement-2:
if 3rd column value is "w" (just before hyphens) then I should make it to "b" and vice-versa.
I could get them done but with some poor scripting. I read value of each column and compare and echoing to another file but I guess awk/sed would do so much effecient. I have no idea how to use awk.
Please provide me 2 different commands separately as sometimes I may have to do only one of them.
Hi ,
I have some data in my file(properties.txt) like this.
# agent.properties
agent.dmp.Location=
agent.name=
I need to relpace the
agent.dmp.location with agent.dmp.Location = /opt/VRTS/vxvm
I am using the follwing to replace the string
AGENT_NAME=snmp... (2 Replies)
Hi ,
I need some help on perl/sed conditional replacement
The situation is like below .
I have a file contents like below .
AAA|BBB|CCC|DDD
AAA|BCF|CCC|HHH
AAA|BVF|JJJ|KKK
Here in the above file . I know my second column value (taking "|" as my delimited )
Basically I have to... (3 Replies)
Hi
I am struggling to find a solutions to this problem:
I have a directory full of files and I wish to:
read each line of each file and
if any one line in those files is longer than 72 characters I want to replace any tab characters with a space character.
Ive been... (3 Replies)
Hello Gurus,
I have a text file containing nearly 12,000 tab delimited characters with 4000 rows. If the file size is small, excel can convert the text into coloumns. However, the file that I have is very big. Can some body help me in solving this problem?
The input file example,
... (6 Replies)
Hi all,
I need a bash, sed, awk script or one liner to do the following task:
This is the format of a text file:
2010-06-11 20:01 902656 HOP-W-100412-1.doc
2010-11-05 18:01 364447 NEX-W-101104-1
2010-07-06 10:01 64512 Cerintele
2010-07-06 10:01 599420 content
2010-07-19 14:01 1785344... (7 Replies)
Hello,
I'm new to this forum but this seems like the place to ask this question.
I have a pipe delimited data file with the fields except for the header being encased in double quotes. I found out that some of the fields have an trash pipe within the data itself. I'd like to conditionally... (4 Replies)
I have a text file that has three columns. But at the end of the text file, there are trailing lines that have missing second and third columns:
4 0.04972604 KLHL28
4 0.0497332 CSTB
4 0.04979822 AIF1
4 0.04983331 DECR2
4 0.04990344 KATNB1
4
4
4
4
How can I remove the trailing... (3 Replies)
Hello,
I want to concatenate 2-columns by 2-columns separated by colon. How can I do so? For example, I have a text file containing 6 columns separated by tab. I want to concatenate column 1 and 2; column 3 and 4; column 5 and 6, respectively, and put a colon in between.
input file:
1 0 0 1... (10 Replies)
Hello,
I have many CSV files with variable number of rows and columns.
Sample of few problematic CSV files.
,,Price,Price,Price,Price,Price,Price,Price,Price,Price,Qty
Date,Sl,AAA,BBB,CCC,DDD,EEE,FFF,GGG,HHH,PriQueue,%busy
30/07/2014,1,AAA,BBB,CCC,DDD,EEE,FFF,GGG,HHH,NA,0... (8 Replies)
Hi all,
Saying we have two files:
1. A "Reference File" whose content is "Variable Name": "Variable Value"
2. A "Model File" whose content is a model program in which I want to substitute "VariableName" with their respective value to produce a third file "Program File" which would be a... (4 Replies)