Unique Format Requirements for Save As

keithk

New Member
Joined
Jun 24, 2002
Messages
17
I'm having difficulty saving a file in a format required for subsequent processing. I've tried saving my file as text, but Excel surrounds the saved fields with quotes. I've also tried saving as a CSV, but that yields extra commas in rows that start with "** ". Anybody have a suggestion on how i can save a file using VBA so it looks like this?:

----FILE BEGINS

X,2002-10-15,00:51:37
ACTUAL
OMCSheets
** BTS
bsc_id
bcf_id
bts_id
bts_address
frequency_band_in_use
mcc
mnc
bsic_ncc
bsic_bcc
cell_barred
call_reestabl_allowed
** POWER_CONTROL
bsc_id
bts_id
pc_control_enabled
pc_control_interval
bs_tx_pwr_max
bs_tx_pwr_min
pc_incr_step_size
pc_red_step_size
pc_a_l_dl_window_size
** ADJACENT_CELL
bsc_id
bts_id
parent_la_id_lac
parent_cell_id
adj_cell_lac
adj_cell_ci
adj_cell_bsic_ncc
adj_cell_bsic_bcc
adj_cell_bcch_frequency
ms_tx_pwr_max_cell
synchronized
enable_ho_margin_l_q
ho_priority_level
ho_load_factor
ho_margin_pbgt
***
** BTS
49722,27,80,War Eagle,1,310,210,7,4,0,1,,,,
49722,27,81,War Eagle,2,300,380,3,3,1,0,,,,
49722,6,17,Star,2,310,380,6,7,0,1,,,,
49722,6,16,Star,2,310,380,6,7,0,1,,,,
49722,6,18,Star,2,310,380,6,7,0,1,,,,
** POWER_CONTROL
49722,51,0,1,0,15,1,0,6,,,,,,
49722,99,1,1,0,15,1,0,3,,,,,,
49722,78,1,0,2,15,1,0,6,,,,,,
49722,77,0,1,5,15,1,1,6,,,,,,
49722,81,1,1,4,15,0,0,6,,,,,,
49722,22,1,1,0,5,1,0,6,,,,,,
** ADJACENT_CELL
49722,47,14020,1432,14020,1382,2,4,598,0,0,1,3,1,4
49722,47,14020,1432,14020,1232,2,2,596,1,0,1,3,1,6
49722,47,14020,1432,14020,1331,2,1,589,0,0,1,4,0,5
49722,47,14020,1432,14020,1453,2,4,604,0,1,0,3,1,4
49722,47,14020,1432,14020,1231,2,1,599,0,0,1,3,1,6

----END OF FILE

Above, where commas exist, the data is coming from separate cells. Cumbersome soultions are welcome! Thx, -k
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Oops. The format i need for further processing must supply quotes around text fields.

The top of the file is header info. The bottom of the file is data. The two are separated by "***". thanks, -keithk

----BEGIN FILE

X,2002-10-15,00:51:37
ACTUAL
OMCSheets
** BTS
bsc_id
bcf_id
bts_id
bts_address
frequency_band_in_use
mcc
mnc
bsic_ncc
bsic_bcc
cell_barred
call_reestabl_allowed
** POWER_CONTROL
bsc_id
bts_id
pc_control_enabled
pc_control_interval
bs_tx_pwr_max
bs_tx_pwr_min
pc_incr_step_size
pc_red_step_size
pc_a_l_dl_window_size
** ADJACENT_CELL
bsc_id
bts_id
parent_la_id_lac
parent_cell_id
adj_cell_lac
adj_cell_ci
adj_cell_bsic_ncc
adj_cell_bsic_bcc
adj_cell_bcch_frequency
ms_tx_pwr_max_cell
synchronized
enable_ho_margin_l_q
ho_priority_level
ho_load_factor
ho_margin_pbgt
***
** BTS
49722,27,80,"War Eagle",1,310,210,7,4,0,1,,,,
49722,27,81,"War Eagle",2,300,380,3,3,1,0,,,,
49722,6,17,"Star",2,310,380,6,7,0,1,,,,
49722,6,16,"Star",2,310,380,6,7,0,1,,,,
49722,6,18,"Star",2,310,380,6,7,0,1,,,,
** POWER_CONTROL
49722,51,0,1,0,15,1,0,6,,,,,,
49722,99,1,1,0,15,1,0,3,,,,,,
49722,78,1,0,2,15,1,0,6,,,,,,
49722,77,0,1,5,15,1,1,6,,,,,,
49722,81,1,1,4,15,0,0,6,,,,,,
49722,22,1,1,0,5,1,0,6,,,,,,
** ADJACENT_CELL
49722,47,14020,1432,14020,1382,2,4,598,0,0,1,3,1,4
49722,47,14020,1432,14020,1232,2,2,596,1,0,1,3,1,6
49722,47,14020,1432,14020,1331,2,1,589,0,0,1,4,0,5
49722,47,14020,1432,14020,1453,2,4,604,0,1,0,3,1,4
49722,47,14020,1432,14020,1231,2,1,599,0,0,1,3,1,6

----END OF FILE
 
Upvote 0

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top