list of items to a table in LOcalc and then to a db

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 : )

Hi!
Some the search/replace that you are attempting to do can be performed
easily with the AltSearch extension (http://extensions.libreoffice.org/
extension-center/alternative-dialog-find-replace-for-writer) in Writer.
You can then create a table with this data, and once you have a table
made with your data in Writer, you can cut/paste directly into Calc.
I hope this helps.
Rémy Gauthier.

Hola Remy : )

On Sat, 06 Aug 2016 18:58:02 -0400, Remy escribió:

Some the search/replace that you are attempting to do can be performed
easily with the AltSearch extension (http://extensions.libreoffice.org/
extension-center/alternative-dialog-find-replace-for-writer) in Writer.
You can then create a table with this data, and once you have a table
made with your data in Writer, you can cut/paste directly into Calc.

Thank you for directing me to that extension, I'll be using it from
now on for many things. It's great!

However, for the task in hand, that is, replacing end of line
(non-printable) character doesn't work I'm afraid.
In theory what one looks for is the "salto de línea manual /n",
right? In English that must be "Manual line feed /n" I presume. Or is
it CR/LF? Not sure.
Ok. It simply ignores it.
If I include some spaces at the beginning of the next line, it includes
them in the search and even replaces them with, in this case, a comma. But
the linefeed stays where it is.

I can see the (non-printable) character as a mirrored blue capital p by
going to View > Non-printable characters Ctrl + F10. But even trying to
copy that into the search box doesn't produce anything to look for.

I'll keep on searching.

Thank you again for the suggestion, Rémy.

Felipe : )

Hi. If you search back on the list (may be in nabble if your subscription has not been long) you may find some information.
Looking quickly I found the below. I am not sure this is what you need, but I think the search term is not /n.

To get rid of the blank paragraph, use Edit > Find and Replace, Click Other options, and check Regular expressions. In the search field enter ^$

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.