read one line file and separate into multiple lines
I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field.
example input line:
output:
thanks for your pointer...
I am using the while-loop to read a file.
The file has lines with null-terminated strings (words, actually.)
What I have by that reading - just a first word up to '\0'!
I need to have whole string up to 'new line' - (LF, 10#10, 16#A)
What I am doing wrong?
#make file 'grb' with... (6 Replies)
I have one line files with 17 records separated by a semi-colon. I need to create a variable from each record, which I can do via a separate awk for each one, but I know there has to be a better way. Along with pulling out the variable, I need to convert some url coding like a + to a space, etc.... (4 Replies)
Hello UNIX experts,
I have 124 text files in a directory. I want to extract the 45678th line of all the files sequentialy by file names. The extracted lines should be printed in the output file on seperate lines.
e.g. The input Files are one.txt, two.txt, three.txt, four.txt
The cat of four... (1 Reply)
Hi,
I have a file like this
cpsSystemNotifyTrap='2010/12/14 11:05:31 CST' Manufacturer=IBM ReportingMTMS=n/a ProbNm=26 LparName=n/a FailingEnclosureMTMS=7946-IQL*99G4874 SRC=B3031107 EventText=Problem reported by customer. CallHome=true Calendar
I want to have a output like this... (6 Replies)
Hi Unix gurus,
I am facing a problme with file. I need separate my file into multiple line.
eg.
Soure file: PRT07, aaa, bbb, 46, PRT06, ccc, ddd, 57, PRT05, eee,fff,aa,
target file:
PRT07, aaa, bbb, 46
PRT06, ccc, ddd, 57
PRT05, eee,fff,aa
:wall:
thanks in advance (4 Replies)
I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field.
example input line:
... (1 Reply)
Hi all
I have spent half a day trying to create a shell script which reads a configuration file on a line by line basis.
The idea of the file is that each will contain server information, such as IP address and various port numbers. The line could also be blank (The file is user created). Here... (1 Reply)
Hi Experts,
I am having a requirement like this;
Input file
EIM_ACCT.ifb|1001|1005
EIM_ADDR.ifb|1002|1004
EIM_ABD.ifb|1009|1007
I want to read each line of this file and pass each line,one at a time,as an argument to another script.
eg;
1.read first line->store it to a file->call... (2 Replies)
performing this code to read from file and print each character in separate line
works well with ASCII encoded text
void
preprocess_file (FILE *fp)
{
int cc;
for (;;)
{ cc = getc (fp);
if (cc == EOF)
break;
printf ("%c\n", cc);
}
}
int
main(int... (1 Reply)
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Discussion started by: Ferocci
8 Replies
LEARN ABOUT DEBIAN
pydhcplib.ipv4
pydhcplib.ipv4(3) PYDHCPLIB pydhcplib.ipv4(3)NAME
pydhcplib.ipv4 - Type for IP addresses version 4
SYNOPSIS
from pydhcplib.type_ipv4 import ipv4
a = ipv4()
a = ipv4(string)
a = ipv4(strlist)
a = ipv4(int)
DESCRIPTION
The class pydhcplib.ipv4 is a type "IP address version 4". It's used for string processing like "192.168.0.4".
The class creation argument can be a string like "192.168.0.4".
The class creation argument can be a list of bytes like [192,168,0,4].
METHODS
The implemented methods in this class are mostly methods of comparison (= =, >, etc...)
else :
str() return data converted into a printable string.
list() return data converted into a list of bytes.
int() return data converted into an 4 bytes int.
EXAMPLES
Example program ipv4_example.py :
from pydhcplib.type_ipv4 import ipv4
address = ipv4()
address1 = ipv4("192.168.0.1")
address2 = ipv4("10.0.0.1")
address3 = ipv4([192,168,0,1])
print "a0 : ",address
print "a1 : ",address1
print "a2 : ",address2
print "a3 : ",address3
if address1 == address2 :
print "test 1 : ",address1, "==",address2
else :
print "test 1 : " ,address1, "!=",address2
if address1 == address3 :
print "test 2 : ", address1, "==",address3
else :
print "test 2 : ", address1, "!=",address3
SEE ALSO pydhcp(8), pydhcplib.hwmac(3), pydhcplib.ipv4(3), pydhcplib.strlist(3), pydhcplib.DhcpPacket(3), pydhcplib.DhcpBasicPacket(3), pydhc-
plib.DhcpNetwork(3), pydhcplib.DhcpClient(3), pydhcplib.DhcpRawClient(3), pydhcplib.DhcpDerver(3)BUGS
See http://pydhcplib.tuxfamily.org/ for more information.
AUTHOR
Mathieu Ignacio (mignacio[AT]april.org)
pydhcplib.ipv4(3)