- AuthorPosts
- September 23, 2011 at 4:14 pm #9671userParticipant
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!
September 23, 2011 at 4:45 pm #9672CrashNBurnMemberSave the excel document as a CSV.
Open file in EmEditor.
Edit -> Separated Values/Sort -> CSV Mode
September 23, 2011 at 5:03 pm #9673userParticipantthanks, 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)
September 23, 2011 at 6:18 pm #9674CrashNBurnMemberAH! 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,kgIf 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,n5Step 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 7nFinal Output:
34,George,Clooney,123456,356 mg,324 ml,635 kg
September 23, 2011 at 8:14 pm #9675userParticipantthanks 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,rfand not just:
34,George,Clooney,3456346,LDL,356,mg
34,George,Clooney,3456346,HDL,324,ml
34,George,Clooney,3456346,VLDL,635,kgany hint?
September 23, 2011 at 8:25 pm #9676CrashNBurnMemberAt the right of the Search field is [>]
Click on that and choose “Multiline”September 23, 2011 at 9:09 pm #9677userParticipantthere is no multiline displayed in your posted search and replace values (probably due to the forum format)
can you paste them as plain text?
September 23, 2011 at 10:07 pm #9679CrashNBurnMemberMultiline 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 [>]September 24, 2011 at 10:15 am #9680userParticipant> 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,rfand not just:
34,George,Clooney,3456346,LDL,356,mg
34,George,Clooney,3456346,HDL,324,ml
34,George,Clooney,3456346,VLDL,635,kgisn’t there any problem with that?
September 24, 2011 at 4:19 pm #9681CrashNBurnMemberEmEditor 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. CRLFThe 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.
- AuthorPosts
- You must be logged in to reply to this topic.