473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Skip a row/line of csv file.

Hi Guys, I would like to skip a line from my database.... this is how the line starts: A.SERIAL_NUMBER||' I'm using the following code, but it doesnt seem to work, what am i doing wrong?ps. i want to ignore this line and let the data to be added to the database........


if(substr($data[0],0,length("A.SERIAL_NUMBER||")-1)
eq "A.SERIAL_NUMBER||")

{

$indata++;

}

Thanks a lot
May 4 '12 #1
1 2809
RonB
589 Expert Mod 512MB
You probably will need to provide more details because this line is a little contradictory.
i want to ignore this line and let the data to be added to the database
Does this help?
Expand|Select|Wrap|Line Numbers
  1. next if $data[0] =~ /^A.SERIAL_NUMBER/;
May 4 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tony | last post by:
Hi, I have dynamically created a PDF document in memory as a FileOutputStream Now I have to get it into a DB2 table, storing it as a BLOB. The table has a document id, document name, some date...
2
by: CsharpGuy | last post by:
I have to read a text file and parse it out to load to a db and I'm having some issues in doing it. here is what the text file looks like Dealership number: 98665362236 Location: Maryland...
2
by: jimb20 | last post by:
ive looked for this and the basic code for inputs but it doesnt have anything about this example: say my file looks like this ------------- yes no 1 14 -------------
1
by: charlyrosario | last post by:
I am using ksh to get one line csv file from the output of df -k. The only information i need is: File System Name and FS Usage Example: /,50,/usr,45,/var,43 All info in ONE line ...
6
by: jimwest1995 | last post by:
Hi! I have a text file with 60 lines in it and I need to skip to line 51 to begin processing. In VB6 there was .SkipLine but I don't see that function in VB.Net. Any suggestions on how to do this?...
2
by: ogo796 | last post by:
hi all i am having a problem with reading the lines from the text file my file look like this: #"11-02-2008 " chief vs tumi "1234" "12-02-2008 " duma vs duma "1254" i am wondering if the...
9
by: antar2 | last post by:
I am a starter in python and would like to write a program that reads lines starting with a line that contains a certain word. For example the program starts reading the program when a line is...
3
by: lilly07 | last post by:
I am new to perl. I would like to open a file and print 2,6,10,14.. etc lines of that file content. How to do it? I amm able to open a file and print the contetnts as below: #!usr/bin/perl ...
13
by: youngjin.michael | last post by:
Hello, I am new to Python and have one simple question to which I cannot find a satisfactory solution. I want to read text line-by-line from a text file, but want to ignore only the first line....
0
by: ruthyoung | last post by:
Since our organization accelerates business applications across the distributed enterprise, we require some D2D backup repository to accelerate file backup and recovery. Please suggest some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.