Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #9671
    user
    Participant

    hello

    I have in an excel file a table like this and I want to make it look like the table below:

    anyone know how to do it?

    thanks!

    #9672
    CrashNBurn
    Member

    Save the excel document as a CSV.

    Open file in EmEditor.

    Edit -> Separated Values/Sort -> CSV Mode

    #9673
    user
    Participant

    thanks, but I don’t think you understood my question

    I know how to create csv files and open then in EmEditor

    what I want is to transform the first table into the second (as shown in the picture)

    #9674
    CrashNBurn
    Member

    AH! Sorry :-)

    Well given the following input:

    34,George,Clooney,123456,LDL,356,mg
    34,George,Clooney,123456,HDL,324,ml
    34,George,Clooney,123456,VLDL,635,kg

    If your file is tab delimited instead of commas, then you will need to replace all commas below with “t”

    Step 1:

    Search: ^(d+),([A-Za-z]+),([A-Za-z]+),(d+),(.*)
    Replace: 1,2,3,4,n5

    Step 2:

    Search: ^(d+,[A-Za-z]+,[A-Za-z]+,d+,)n[A-Z]+,(d+),([a-z]+)n1n[A-Z]+,(d+),([a-z]+)n1n[A-Z]+,(d+),([a-z]+)n
    Replace: 12 3,4 5,6 7n

    Final Output:

    34,George,Clooney,123456,356 mg,324 ml,635 kg

    #9675
    user
    Participant

    thanks for your reply

    it would be interesting if it works, but I got the message “Cannot find ^(d+),([A-Za-z]+),([A-Za-z]+),(d+),(.*) anywhere in the document”

    (regex are enabled)

    also, please note that the original text is:

    34,George,Clooney,3456346,LDL,356,mg
    34,George,Clooney,3456346,HDL,324,ml
    34,George,Clooney,3456346,VLDL,635,kg
    34,Tom,Cruise,4573456,LDL,463,dl
    34,Tom,Cruise,4573456,HDL,746,cm
    34,Tom,Cruise,4573456,VLDL,435,dc
    35,Al,Pacino,5646464,LDL,467,hg
    35,Al,Pacino,5646464,HDL,352,df
    35,Al,Pacino,5646464,VLDL,643,rf

    and not just:
    34,George,Clooney,3456346,LDL,356,mg
    34,George,Clooney,3456346,HDL,324,ml
    34,George,Clooney,3456346,VLDL,635,kg

    any hint?

    #9676
    CrashNBurn
    Member

    At the right of the Search field is [>]
    Click on that and choose “Multiline”

    #9677
    user
    Participant

    there is no multiline displayed in your posted search and replace values (probably due to the forum format)

    can you paste them as plain text?

    #9679
    CrashNBurn
    Member

    Multiline is a regex option. You need to select it.
    My Search regex is a multiline regex (it contains multiple newlines). You need to select “Multiline” from the pop-up menu that is available when you click [>]

    #9680
    user
    Participant

    > My Search regex is a multiline regex (it contains multiple newlines).

    I know, but when I copy it and paste it in any text editor (not just in the search field of EmEditor), it shows as a single line

    also, have you noted that the original text is:
    34,George,Clooney,3456346,LDL,356,mg
    34,George,Clooney,3456346,HDL,324,ml
    34,George,Clooney,3456346,VLDL,635,kg
    34,Tom,Cruise,4573456,LDL,463,dl
    34,Tom,Cruise,4573456,HDL,746,cm
    34,Tom,Cruise,4573456,VLDL,435,dc
    35,Al,Pacino,5646464,LDL,467,hg
    35,Al,Pacino,5646464,HDL,352,df
    35,Al,Pacino,5646464,VLDL,643,rf

    and not just:
    34,George,Clooney,3456346,LDL,356,mg
    34,George,Clooney,3456346,HDL,324,ml
    34,George,Clooney,3456346,VLDL,635,kg

    isn’t there any problem with that?

    #9681
    CrashNBurn
    Member

    EmEditor Home » EmEditor Help » Dialog Boxes

    > button


    Multiline

    Toggles between singleline and multiline of the drop-down list box (this command appears only in the Find dialog box and Replace dialog box).

    In a Regex string, a n is a newline.
    As well as rn e.g. CRLF

    The fact that my regex is a “single line string” is irrelevant. It contains multiple n newlines, and if you want it to work as intended —- which is to look on multiple lines for search matches/input, then you need to select “Multiline” from the dialog, as I mentioned previously.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.