Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-04-2014, 06:43 AM
|
#1
|
Member
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 218
Rep:
|
Columns
Morning guys
I have a script that creates id's and passwords separated by a white space
xxxxxxxx xxxxxxxx
yyyyyyyy yyyyyyyy
now when i transfer the file from linux too windows and i copy the id's and password into excel it will just copy it into the 1st column only. is their any way round this?
|
|
|
04-04-2014, 06:48 AM
|
#2
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
Your Excel stumbles over the missing DOS line endings.
Before transferring your file from Linux to Windows, run this command on the file to add DOS line endings:
Code:
sed -i 's/$/\r/' your_file
Eric
|
|
|
04-04-2014, 07:10 AM
|
#3
|
Moderator
Registered: Aug 2002
Posts: 26,514
|
In addition you need to specify with Excel what to use as a column separator.
You could also use sed to replace the space with a comma or tab. Excel will automatically open csv files and tab extension files. However, if there are passwords with spaces then you will have problems.
|
|
|
04-04-2014, 07:13 AM
|
#4
|
Member
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 218
Original Poster
Rep:
|
Hello Alien Bob
So once running that command on the file and transferring the txt / docx / xlsx over to windows, i then open the file and copy to another excel / docx and it will still copy the entire line as one rather than just copying the username or password
|
|
|
04-04-2014, 07:35 AM
|
#5
|
Member
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 647
|
You are generating the file with spaces between the fields. Just try to generate the file with a comma between the 2 fields.
So, don't do "xxxxxxx yyyyyyyy" - rather do "xxxxxxxx,yyyyyyy".
The excel should import perfectly fine. Assuming the line-ending is cr-lf (as AlienBob suggests).
|
|
|
04-04-2014, 07:40 AM
|
#6
|
Member
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 218
Original Poster
Rep:
|
Hello
Cheers for the reply,
Unfortunately the script that we use for creating ID's is pretty old and No-one can re-write the script YET. Just trying too make it easier for the guys using the script. The ID's and pass cant be changed for the time being with a , between them. Once the script has done its job it will output the passwords too password.dat which we then convert too docx just curious if we could input a , before converting then run the command alien bob suggest then convert too .csv instead.
Last edited by pr0xibus; 04-04-2014 at 07:47 AM.
|
|
|
04-04-2014, 07:58 AM
|
#7
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,525
|
Two ways to go after the conversion that Alien Bob suggested.
1. Run the file through
to translate the space to comma
2. Load the file into Excel as a .txt file and choose Space as the delimiter.
|
|
|
All times are GMT -5. The time now is 08:16 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|