10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have two files which look like this
cat waitstate.txt
18.2
82.1
cat gostate.txt
5.6
5.8
6.1
6.3
6.6
6.9
7.2
7.5 (4 Replies)
Discussion started by: jamie_123
4 Replies
2. Shell Programming and Scripting
Hi all,
I have a requirement to replace a field with a character as per the length of the field.
Suppose i have a file where second field is of 20 character length. I want to replace second field with 20 stars (*). like ********************
As the field is not a fixed one, i want to do the... (2 Replies)
Discussion started by: gani_85
2 Replies
3. Shell Programming and Scripting
Hi,
I am trying to figure out how to get the length of the longest column in the entire file (because the length varies from one row to the other)
I was doing this at first to check how many fields I have for the first row:
awk '{print NF; exit}' file
Now, I can do this:
awk '{ if... (4 Replies)
Discussion started by: MIA651
4 Replies
4. Shell Programming and Scripting
Hello Everyone,
I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table.
Input Data-
------ ------------------------ ---- -----------------
WFI001 Xxxxxx Control Work Item A Number of Records
------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies
5. Shell Programming and Scripting
I have a sample txt file which has different variable lengths of 2,10,3,15.
What is the command that I need use in order to get the record count that has length '3'
Thanks (3 Replies)
Discussion started by: bobby1015
3 Replies
6. UNIX for Dummies Questions & Answers
HI
In my script, i am reading the input from the user and want to find the length of the string.
The input may contain leading spaces. Right now, when leading spaces are there, they are not counted.
Kindly help me
My script is like below. I am using the ksh.
#!/usr/bin/ksh
echo... (2 Replies)
Discussion started by: dayamatrix
2 Replies
7. Shell Programming and Scripting
I have a pipe delimited file. I need to check that the first and second fields are 5 characters long and if not i need to append 0 in front of them to make them 5 characters long. can some body let mwe know how i can find the length of the two fields and then make them 5 characters long if they... (6 Replies)
Discussion started by: dsravan
6 Replies
8. Shell Programming and Scripting
Hi guys, I hope you can help me with my problem.
I have a text file that contains lines like this:
78 ANGELO -809.05
79 ANGELO2 -5,000.06
I need to find all occurences of amounts that are negative and replace them with x's
78 ANGELO xxxxxxx
79... (4 Replies)
Discussion started by: amangeles
4 Replies
9. UNIX for Dummies Questions & Answers
What's wrong with this part of my script?
I just want to put each column from a fixed length file into a variable so I can validate each field later in the script.
exec< myfile.dat
while read afile; do
a=`echo $(echo $afile |cut -c1-10)`
echo "$a"
b=`echo $(echo $afile |cut -c11-20)`... (12 Replies)
Discussion started by: giannicello
12 Replies
10. Shell Programming and Scripting
:confused: Does anyone know which command I can use to find out the length of a string held within a variable? (5 Replies)
Discussion started by: dbrundrett
5 Replies