10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I got a question. I have several csv files with lots of data in it and for the first column i have EAN codes.
The problem that i am facing is that some of these codes have the leading 0 removed so they are 12 or less chars while a EAN code is (always?) 13 chars.
For this i used a... (9 Replies)
Discussion started by: SDohmen
9 Replies
2. Shell Programming and Scripting
Hi,
I wish to grep everything before the last "/bin" in the following string
/opt/app/bin/app1/jdk150_07/bin/IA64N/java
Desired output: "/opt/app/bin/app1/jdk150_07"
Kindly help ... (2 Replies)
Discussion started by: mohtashims
2 Replies
3. Shell Programming and Scripting
HI,
I have a string "NZ-deploy-mode-1.15-Linux.x86_64.rpm"
I want to get the string before -1 ie "NZ-deploy-mode"
Input is "NZ-deploy-mode-1.15-Linux.x86_64.rpm"
expected output is "NZ-deploy-mode"
How can I do that in shell script?
Thanks in advance. (6 Replies)
Discussion started by: Ananthdoss
6 Replies
4. Shell Programming and Scripting
removing leading zeros for a decimal column in a file which has string & decimal values
,,,,,6630140,XXXXXXXXXXXXXXX, 0020.00,USA
,,,,,6630150,XXXXXXXXXXXXXXXL (xyz, 0010.00,USA
,,,,,6630150,XXXXXXXXXXXXXXX(xyz), 1300.00,USA
My file contains 9 columns. Out 9 columns, 8th column contains the... (9 Replies)
Discussion started by: marpadga18
9 Replies
5. Shell Programming and Scripting
Hi all-
I've got a file that will have multiple columns. In one column there will be a string that is 10 digits in length, but I need to trim the first four zeros to make it 6 characters?
example:
0000001234
0000123456
0000234566
0000000321
output:
001234
123456
234566
000321 (5 Replies)
Discussion started by: Cailet
5 Replies
6. Shell Programming and Scripting
Hi All,
I have a UNIX file, which has Total of 532 column, each delimited with ^~^. One of the column (419) is 202 character long. In real case, it should be 22 character long.
cut -d~ -f419 filename
... (4 Replies)
Discussion started by: Amit.Sagpariya
4 Replies
7. 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
8. UNIX for Dummies Questions & Answers
Hey Everybody,
I am having much trouble figuring this out, as I am not really a programmer..:mad:
Datafile.txt
Column0 Column1 Column2
ABC DEF xxxGHI
I am running using WGET on a cronjob to grab a datafile, but I need to cut the first three characters from... (6 Replies)
Discussion started by: rickdini
6 Replies
9. Shell Programming and Scripting
Hi
I have a file in which I have 5 columns which are delimited by “|” as shown
ABC|12|YAK|METRIC|000000019.5
XYZ|10|ABX|META|000000002.5
Now my requirement is to take the last column trim the leading zero's for that column values and write back to the same file in the same... (7 Replies)
Discussion started by: nvuradi
7 Replies
10. Shell Programming and Scripting
How do I trim the leading zeroes, and (+,-) in the currency field ?
I have a text file.
Your bill of +00002780.96 for a/c no. 25287324 is due on 11-06.
Your bill of +00422270.48 for a/c no. 28931373 is due on 11-06.
I want the O/P file to be like.
Your bill of 2780.96 for a/c no. 25287324... (22 Replies)
Discussion started by: Amruta Pitkar
22 Replies