If you are using a variant of linux.

Suggest looking up how to use 'sed'.

http://unix.stackexchange.com/questions/153091/how-to-add-a-carriage-return-before-every-newline

Many examples are available to be Googled. Just type in 'sed replace' and what your trying to replace.

It is very powerful, although it takes getting used.

On 8/6/2016 6:26 PM, Felipe T. Dorado wrote:
Hi!

I'm trying to get a list of items with subfields on a nice table to import
in LO database.
For instance, the output of the listing of the command

        # iwlist wlan0 scan > nearby_wifi_nodes

which is a list of the wifi nodes near my router.

I have tried opening the raw text file in LO writer:

        try1:   converting the list to a table separating text with Tab
        -->  each line goes to the first cell of a table with 1 column

        try2: "Paste Special" the text onto a spreadsheet in calc with
        options "transpose" and "skip empty cells" marked
        -->   I get all the text separated in cells but on only 1 row.

I have tried leaving the text as what I believe is a CSV format by removing
line feeds and replacing them with comas but I have not succeeded since I'm
not able to find the correct code for line feeds in LO writer's
"Find&Replace" dialog. I tried "^p", copied from the end of a line to the
beginning of the next and some other ways. No luck.
I managed to do it with the editor  gedit  in Gnome: copied the end of a
line to the next, opted for the Replace function and placed a coma instead.
It worked!
I then proceeded to eliminate the tabs/blank spaces with the same funtion
and I just had to look for ",Cell ", erase the coma and replace it with a
line feed before each appearance. I saved the file with extension .csv.

I then copied the text in this cvs file and pasted it in a new calc
spreadsheet. Viola! I had the file in a nice table. Save for the fields
that I have to rearrange so I have the headers/fields correct to pass them
onto a table in the database.
That is, I got a table like this:

Cell 01 - Address: 00:16:B6:39:7C:10 Channel:6 Frequency:2.437 GHz (Channel 6)
Cell 02 - Address: 54:67:51:22:F4:13 Channel:1 Frequency:2.412 GHz (Channel 1)
Cell 03 - Address: 4C:09:D4:9D:E5:78 Channel:1 Frequency:2.412 GHz (Channel 1)
Cell 04 - Address: 94:4A:0C:BC:18:71 Channel:4 Frequency:2.427 GHz (Channel 4)
and so on. With a lot more columns of course.

Questions:
- How does one replace linefeeds with whatever?
- Is there a way to do this within LO without having to use an external
   editor to get rid of the linefeeds?
- Is there a simpler way to do what i pretend?

Thank you.

Felipe  : )



--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to