Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,043 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,535 people online right now. Registration is fast and FREE... Join Now!




Extract Data From Csv?

 
Reply to this topicStart new topic

Extract Data From Csv?

The Neoracle
18 Nov, 2002 - 04:54 PM
Post #1

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
Any one have some ideas as to how one could extract a value from a CSV file and put it in a DB?

Thanks,
User is offlineProfile CardPM
+Quote Post

arniie
RE: Extract Data From Csv?
19 Nov, 2002 - 01:09 AM
Post #2

D.I.C Addict
****

Joined: 8 Oct, 2002
Posts: 999

Can't you just open the csv file with ms excel and then input it into the database with an insert/update sql statement
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: Extract Data From Csv?
19 Nov, 2002 - 07:30 AM
Post #3

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
QUOTE(arniie @ Nov 19 2002, 06:09 AM)
Can't you just open the csv file with ms excel and then input it into the database with an insert/update sql statement

The file has 1000's of entries and I only need one collum, I'd rather only put those in the correct table than have to put the whole thing in and select out a row and put that row where I need it. Plus I want to figure out how to do this. tongue.gif
User is offlineProfile CardPM
+Quote Post

arniie
RE: Extract Data From Csv?
19 Nov, 2002 - 08:13 AM
Post #4

D.I.C Addict
****

Joined: 8 Oct, 2002
Posts: 999

I'm not sure if its me not understanding what YOU mean or the other way round.

Open the CSV file extract the data (colomn) you want make new csv file and upload that ?!

No.... blink.gif
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: Extract Data From Csv?
19 Nov, 2002 - 03:07 PM
Post #5

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
It's not set up that way, every 4th line is the one I want, it's a weird CSV file.
User is offlineProfile CardPM
+Quote Post

arniie
RE: Extract Data From Csv?
20 Nov, 2002 - 01:15 AM
Post #6

D.I.C Addict
****

Joined: 8 Oct, 2002
Posts: 999

I'm probably pissing you off with this 'excel' talk ....

but if its every 4th line, you could use an excel formula/expression to extract every fourth line
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: Extract Data From Csv?
20 Nov, 2002 - 12:21 PM
Post #7

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
QUOTE(arniie @ Nov 20 2002, 06:15 AM)
I'm probably pissing you off with this 'excel' talk ....

but if its every 4th line, you could use an excel formula/expression to extract every fourth line

Ok, and how would I do that. I have excel so I can open it in that but I have used it like twice in my H.S. typing class (6 years ago).
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Extract Data From Csv?
20 Nov, 2002 - 12:47 PM
Post #8

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
ok, let me see if i can help, you don't want a column, you want every 4th row?
User is offlineProfile CardPM
+Quote Post

arniie
RE: Extract Data From Csv?
20 Nov, 2002 - 12:51 PM
Post #9

D.I.C Addict
****

Joined: 8 Oct, 2002
Posts: 999

fyrestorm: yes he does

RDS: do you know anything about macro's?
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Extract Data From Csv?
20 Nov, 2002 - 01:08 PM
Post #10

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
there's got to be something common in those every 4th row, and if that's the case you can do a sort then just cut and paste that data into a new workbook, save as a csv and then import it into phpmyadmin
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: Extract Data From Csv?
21 Nov, 2002 - 02:01 PM
Post #11

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
QUOTE(fyrestorm @ Nov 20 2002, 06:08 PM)
there's got to be something common in those every 4th row, and if that's the case you can do a sort then just cut and paste that data into a new workbook, save as a csv and then import it into phpmyadmin

I'm gonna work on this way.
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Extract Data From Csv?
21 Nov, 2002 - 02:33 PM
Post #12

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
let me know if you need any help, i'm good at this sort of stuff
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 04:48PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month