DEALING WITH DIFFERENT FORMATS

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

DEALING WITH DIFFERENT FORMATS

kalyannjoing
Hi All,

      I got a problem here when importing a csv file. Thing is i see different formats of values for the same variable.like assume order_charge1 as variable name and \N and 0 are cases under that variable. Can you pls help me importing such files.

               order_charge1

                     \ N
                      \N
                      \N
                       0
                       0
Thanks
Kalyan
Reply | Threaded
Open this post in threaded view
|

Re: DEALING WITH DIFFERENT FORMATS

David Marso
Administrator
Maybe somebody fatfingered along the way and your data are FUBAR in some way.
You would do yourself a favor by being a little more specific in how you are exactly currently reading your data and what are the valid values for this field.  You did the other day indicate you were having some issues reading a 30G file -this is obviously related to that misadventure-?
Personally I believe exchanging data in a csv format is an incredibly horrible, ass backwards practice and those who do so should seek employment in something other than data praxis (maybe flipping burgers or scrubbing toilets).  Simply for the sake of those who would like to put such data providers out of their (the data receivers) misery.

kalyannjoing wrote
Hi All,

      I got a problem here when importing a csv file. Thing is i see different formats of values for the same variable.like assume order_charge1 as variable name and \N and 0 are cases under that variable. Can you pls help me importing such files.

               order_charge1

                     \ N
                      \N
                      \N
                       0
                       0
Thanks
Kalyan
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: DEALING WITH DIFFERENT FORMATS

kalyannjoing
Thank you for responding David,

Can't spss do anything(atleast to import it) with such data?.... my 30 GB file contains lots of such data. What can i do man?

Thanks again.
Reply | Threaded
Open this post in threaded view
|

Re: DEALING WITH DIFFERENT FORMATS

David Marso
Administrator
You didn't answer my question re what are you currently doing as far as attempting to read the data?
So I riddle you with the following:
You might want to contact your data provider and alert them to the fact that they might have some serious issues .  It is likely not an SPSS issue (it does what you tell it to do but it can't turn a sow's ear into a silk purse).  If there are any missing data delimiters and you are using DATA LIST FREE the remainder of the file after the first hiccup will be crap.
If you use DATA LIST LIST it will only trash a given case.  OTOH of the data spill over multiple lines you are likely to be SOL.  Really hard/ possibly impossible to be of any help without your providing specifics.

** Compare the two sets of syntax**.

*** OOOPS!!!!! FUBAR DATA... FUBAR INPUT STRATEGY ***.
DATA LIST FREE / id a b c.
begin data
1,1,1,1
2,1,1
3,2,2,1
end data.
list.

      ID        A        B        C

    1.00     1.00     1.00     1.00
    2.00     1.00     1.00     3.00


Number of cases read:  2    Number of cases listed:  2



*** OOOPS!!!!! FUBAR DATA... Partially respectable INPUT STRATEGY ***.
DATA LIST LIST / id a b c.
begin data
1,1,1,1
2,1,1
3,2,2,1
end data.
list.

      ID        A        B        C

    1.00     1.00     1.00     1.00
    2.00     1.00     1.00      .
    3.00     2.00     2.00     1.00


Number of cases read:  3    Number of cases listed:  3

kalyannjoing wrote
Thank you for responding David,

Can't spss do anything(atleast to import it) with such data?.... my 30 GB file contains lots of such data. What can i do man?

Thanks again.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: DEALING WITH DIFFERENT FORMATS

Bruce Weaver
Administrator
In reply to this post by kalyannjoing
Does this fix your problem?

new file.
dataset close all.

DATA LIST LIST / id(f2.0) order_charge1(a5).
begin data
1,"\N"
2,"0"
3,"\ N"
4," 0"
end data.

LIST.
COMPUTE order_charge1 = REPLACE(order_charge1," ","").
LIST.



kalyannjoing wrote
Hi All,

      I got a problem here when importing a csv file. Thing is i see different formats of values for the same variable.like assume order_charge1 as variable name and \N and 0 are cases under that variable. Can you pls help me importing such files.

               order_charge1

                     \ N
                      \N
                      \N
                       0
                       0
Thanks
Kalyan
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).