Requirment:-emplid|empl_name|salary|hire_date is my file header and this is fixed length.
sometime, the first record might be attached to the end of the header line.
i have to check if first record is attached with end of the header record then split that record into next line.
note:- i have to check header only from the user input file.
As per your post, i tried i am getting below output.
i dont understand "WHAT?" in output.
my os is: HP-UX and k shell
i am the owner of this directory. also 755 permissions i have.
from Akshay's post i tried , it is not working if it is appened rather than "1111".
Hi,
I am trying to use awk to split line before the pattern:
abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890 abcde 12345 67890
I need it to be like this:
abcde 12345 67890
abcde 12345 67890
abcde 12345 67890
abcde... (7 Replies)
Hi,
I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest.
when i say
#cat $inputFile | while read eachLine
and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters.
Can you... (1 Reply)
Dear All,
I want to split single line into two line or three lines wherever “|” separated values comes using
Input line
test,DEMTEMPUT20100404010012,,,,,,,,|0070086|0070087,
output shoule be
test,DEMTEMPUT20100404010012,,,,,,,,0070086,
test,DEMTEMPUT20100404010012,,,,,,,,0070087, (14 Replies)
I guess this has a simple solution but can't figure out now.
having:
x="H:a:b:c"
to get H:
echo $x|awk -F: {'print $1'}
how can I put REST of line in another one? i.e.
echo $rest
a:b:c
thanks
---------- Post updated at 08:58 PM ---------- Previous update was at... (5 Replies)
Hi,
I have a file that contains multiple lines e.g.
/Plane/Wing/Engine/Rotorblades
I cannot use print $4 as the directories will be different lengths.
All i would like to do is print the very last column in each line in the file i.e. in this case, Rotorblades.
The code i... (4 Replies)
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Hi All,
Hope you guys had a wonderful weekend
I have a scenario where in which I have to read a file line by line
and check for few words before redirecting to a file
I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
Hi All
Is there a way to export every line into new txt file where by the title of each txt output are same as the line ?
I have this txt files containing names:
Kandra Vanhooser
Rhona Menefee
Reynaldo Hutt
Houston Rafferty
Charmaine Lord
Albertine Poucher
Juana Maes
Mitch Lobel... (2 Replies)
I have a very long line in a file separated by "|" delimiter like below. Due to the length of the line, I find it very difficult to read to find a match line.
file = temp.txt
word 1| word 2 | word 3|....
I would like to read the file temp.txt and print out all words line by line like... (1 Reply)
split(1T) Tcl Built-In Commands split(1T)__________________________________________________________________________________________________________________________________________________NAME
split - Split a string into a proper Tcl list
SYNOPSIS
split string ?splitChars?
_________________________________________________________________DESCRIPTION
Returns a list created by splitting string at each character that is in the splitChars argument. Each element of the result list will con-
sist of the characters from string that lie between instances of the characters in splitChars. Empty list elements will be generated if
string contains adjacent characters in splitChars, or if the first or last character of string is in splitChars. If splitChars is an empty
string then each character of string becomes a separate element of the result list. SplitChars defaults to the standard white-space char-
acters.
EXAMPLES
Divide up a USENET group name into its hierarchical components:
split "comp.lang.tcl.announce" .
=> comp lang tcl announce
See how the split command splits on every character in splitChars, which can result in information loss if you are not careful:
split "alpha beta gamma" "temp"
=> al {ha b} {} {a ga} {} a
Extract the list words from a string that is not a well-formed list:
split "Example with {unbalanced brace character"
=> Example with {unbalanced brace character
Split a string into its constituent characters
split "Hello world" {}
=> H e l l o { } w o r l d
PARSING RECORD-ORIENTED FILES
Parse a Unix /etc/passwd file, which consists of one entry per line, with each line consisting of a colon-separated list of fields:
## Read the file
set fid [open /etc/passwd]
set content [read $fid]
close $fid
## Split into records on newlines
set records [split $content "
"]
## Iterate over the records
foreach rec $records {
## Split into fields on colons
set fields [split $rec ":"]
## Assign fields to variables and print some out...
lassign $fields
userName password uid grp longName homeDir shell
puts "$longName uses [file tail $shell] for a login shell"
}
SEE ALSO join(1T), list(1T), string(1T)KEYWORDS
list, split, string
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tclsplit(1T)