I am using space as delimiter and breaking the string to get the values
But in the above string -n key will have some name as value (in place of SOME_NAME)
the problem is here is the SOME_NAME can have any number of special character and any number or spaces or any combination of numeric, alphabets and any special characters.
when I am breaking it with space or "-" as delimiter the name is also breaking up if the name contains the delimiter. My code is like this
My idea is like this: I will pass the length of the SOME_NAME in the java class itself and append it at the end of the string like this "-q LENGTH"
Now In the above code I will get the index of the "-n" (say 35) and I will add the LENGTH(say 15) to the index. So now I wan to cut the 15 characters after the index of -n and store that in a variable.
Please help me with the code
Moderator's Comments:
Please use code tags to format code and listings, and be careful with colors
I am confused. You say it is a Korn shell script but then you start talking about Java classes.
If it is a shell script, you should use getopt to parse the command line options and the easiest way to handle spaces in the -n argument is to require that the argument be quoted i.e.
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
hello All,
I am new user to shell scripting, kindly advise on the below?
I have a file where i have gaps & the delimiter falls in next line and new line is also created , plz see the example :employee.txt
Now the issue here is , i wan to write a script , where i can use "|" to get the... (6 Replies)
Hi all,
I have a number of strings like below:
//mnt/autocor/43°13'(33")W/
and i'm trying to get the numbers in this string, for example
431333
please help
thanks ahead (14 Replies)
Hi All,
I wanted to find 200th field value in delimiter file using awk.?
awk '{print $200}' inputfile
I am getting error message :-
awk: The field 200 must be in the range 0 to 199.
The source line number is 1.
The error context is
{print >>> $200 <<< }
using... (4 Replies)
Hi,
I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
I am having the following file. I need to insert a delimiter in this file. I used sed but its not working.
AAABBB 9 JJJ
AAABBC 9 TTTTT
AAABBA 8 JJJ
AAABBC 7 TTTTT
AAABBC 6 TTTTT
Now i want the output file as:
AAA|BBB| |9| |JJJ|
AAA|BBC| |9| | |TTTTT| (3 Replies)
We are facing a problem with PIPE (|) as a delimiter in one of our FTP flat files.
We are constructing a Flat file in IBM-AIX and this contains various strings delimted by PIPE Symbol and then FTPing this to a Mainframe System
The Mainframe program simply recieves this and FTPs the same... (1 Reply)
HI
can any one tell me how to replace a delimiter : with another delimiter '\001' it is a non printable octal character.
thanks in adv
spandu (4 Replies)