10 More Discussions You Might Find Interesting
1. Programming
I have a file which records banking transactions say like below.
user1 has deposited 10,000$ in his account
user2 has deposited 11,000$ in his account
user1 has withdraw today 5000$ from his account.
Lets say i read this file and convert each line as a list.
username= word
action=... (1 Reply)
Discussion started by: sahil_shine
1 Replies
2. Shell Programming and Scripting
Hi All,
We have a requirement of picking nth position value by using cut command. value would be delimited by any symbols. We have to pass delimited value and postition to get the value in a string.
ex.
echo "A,B,C,D,E" |cut -d "," -f3
echo "A|B|C|D|E"|cut -d "|" -f2
Kindly frame the... (5 Replies)
Discussion started by: KK230689
5 Replies
3. UNIX for Beginners Questions & Answers
Hi All,
I am having a huge file file. I need to cut the below column and do the below calculation
I did the below command and able to do on full databased no on the individual based any help on doing each row by row
cut -c 52-56 myfile | awk '{total = total + $1}END{print total}'... (7 Replies)
Discussion started by: arunkumar_mca
7 Replies
4. UNIX for Dummies Questions & Answers
I have several questions about using awk. I'm hoping someone could lend me a hand. (I'm also hoping that my questions make sense.)
I have a file that contains pipe separated data. Each line has similar data but the number of fields and the field position on each line is variable. ... (3 Replies)
Discussion started by: Cheese64
3 Replies
5. Shell Programming and Scripting
Hi Gurus,
I want to cut my file from 27th charactor to the end of line.
can anybody give some unix command to do this.
Thanks in advance (3 Replies)
Discussion started by: ken6503
3 Replies
6. Shell Programming and Scripting
Hi there script guru's
I have an input file /tmp/in.txt of which the data is seperated by a : (example of the data)
test1:zz:2000:2000:zzz
te:a:2000:3333:bbb
testabs:x:2004:3000:cccc
I would like to run a scrip (bash) changing the data after the second ":"
example
Test for the value of... (3 Replies)
Discussion started by: KobusE
3 Replies
7. Shell Programming and Scripting
HI All,
am trying to find the position of space in a variable, it is working for other characters other than space
ulab="ulab1|ulab2"
find_pos=`expr index $ulab '|'`
echo $find_pos
above code worked fine but below one says syntax error
ulab="ulab ulab2"
find_pos=`expr index $ulab ' '`... (2 Replies)
Discussion started by: ulab
2 Replies
8. Shell Programming and Scripting
Hi all
let's say i have a file named 1234_v2_abcd
i need to find the position of the character located after _v, in above case this would be character number 2
the count of the characters before _v can change, but i always have a number after _v
can anybody help :) (4 Replies)
Discussion started by: gigagigosu
4 Replies
9. Shell Programming and Scripting
How to extract multiple data based on character position. I need to fetch from 7-9 and 22-26 and there is no delimiter for 22-26 since it is part of the column. The file may have more than 1000 character long.I managed to pull any one but not both
for example
test data
12345 zxc vbnmlk... (1 Reply)
Discussion started by: zooby
1 Replies
10. Shell Programming and Scripting
Hi folks
I have a file with thousands of lines with fixed length fields:
sample (assume x is a blank space)
111333xx444TTTLKOPxxxxxxxxx
I need to make a copy of this file but with only some of the field positions, for example I'd like to copy the sample to the follwing: so I'd like to... (13 Replies)
Discussion started by: HealthyGuy
13 Replies