PDA

View Full Version : Columnar block operations



olazarre
September 26th, 2012, 09:42 PM
Currently, I am working with tabular data in a spreadsheet using Microsoft Excel.
The data is being saved in the Text Tab Delimited format.
When the data is imported into V edit the data is not in tabular format such that text in adjacent columns
have a flush right margin to one another.

I am working with the MICROSOFT WINDOWS 7 operating system.

Is there a procedure for working with spreadsheet data in order to take advantage of the columnar block?
capabilities of Vedit?

I've include screen dumps of the data.

Please advise.

pal
September 27th, 2012, 11:22 AM
Use the menu command { Edit > Convert > CSV to flat... }.
The macro should automatically detect the TAB delimiter, so you only need to click OK to covert the file into tabular format.

P.S.
Maybe correct place for this thread is in the "Converting, Translating" forum.

Scott Lambert
September 27th, 2012, 11:25 AM
Hi Olazarre,

1. In MS Excel, select a block and copy it to the clipboard.

2. Make a note of the width of the widest column in the block

3. open vedit

4. Select from the menu: config > Tab/Fill

5. in the Interval/list box, enter the widest column width from step 2, & exit menu

6. from the edit menu, select: Paste columnar clipboard

Does that give you the result, you want?

Scott

ian binnie
September 27th, 2012, 08:35 PM
As Scott mentioned the problem is that the default tabs do not cause the correct columnar display.

Many years ago I wrote some macros to automatically calculate tab widths.
I haven't actually used this for years (since I have retired I don't need to work with much tabbed data), but I think I had this macro (and its mate) mapped to keyboard shortcuts.

There was some discussion of this on the old BB.

Look at:-

http://binnie.id.au/Downloads/TabRight.vdm

I am sure I also had a macro to get the widths from the 1st (header) line and apply to the tabs.

chriz
September 28th, 2012, 09:34 AM
In 2004 I wrote a macro to convert CSV data to TAB delimited data and to set VEDIT's Tabs accordingly:

http://www.ziemski.net/vedit/macros/csv2tab.vdm

It has been a quick hack, though.
The delimter is hardcoded (but changeable of course) and it's limited to 32 TABs in that old version (due to Vedit's limit that time).
The fields in a column are lined up on the left.

There are more TAB-related macros on my site http://www.ziemski.net/vedit/conversions.html,
for example several versions of "tab2fix.vdm",
discussed on the old (now archived) Vedit WebBoard, here: (http://www.ziemski.net/archive -- "VEDIT Technical Support" -- "Converting, Translating" --"Converting Excel tab file to fixed length") or directly: http://www.ziemski.net/archive/threads/039-018292.html

For TAB handling in general I have the following macro in my Vedit.key file:



Ctrl-Shft-Q [VISUAL EXIT] Save_Pos() #103=CL #104=0 OR(103) BoL Repeat(ALL){ if(CC=='"'){S('"', ADVANCE+NOERR+COUNT, 2)} S("|X", ADVANCE) if(CL==#103 && (!At_EoL)){#105=Cur_Col if(#105>65535){break} TC(32) NT(#105,LEFT+NOCR) #104++ if(#104>256){break}}else{break}} OR(CLEAR) if(#104>0){if(#104==1){OR(103) NT(#105,NOCR) NT(#105, NOCR) OR(CLEAR)} RS(103,"Config_Tab(", INSERT) RS(103,")",APPEND) Call(103)} Restore_Pos()


If I have TAB delimited data I insert a manual "ruler" line at the beginning and type for example an "x" for every TAB column begin I want to have displayed in Vedit.
Calling above key macro then sets Vedit's TAB widths according to the ruler line which can be finally deleted.

Perhaps that helps a bit.

Christian

olazarre
September 28th, 2012, 01:40 PM
All,
I am currently reviewing the suggestions posted thus far. Thank you. I will post my outcome as I continue to tackle this issue. Best Regards, Oli,