• Categories

  • Archives

Get file names in Windows

This happened while I was at onsite. The client manager had requested for some 3000+ reports to be created. I did and shared the folder.

He called me, ” I wonder if there is an easier way to get these 3000 report file names in a file or spreadsheet so that I could share the files list with XYZ.”

I gave him the list in the next minute.

I did the following:-
1. Run -> cmd
2. Change path to the folder.
3. dir /b > C:\FileNames.txt
4. Copy the file names into a spreadsheet
5. Email.

Many of us will have similar requirement where this tip can be used –
1. Put the list of names for email attachments in the mail
2. Send the list of source code files modified for review/confirmation to onsite/offshore.
3. Compare the list of files in two folders.
4. Prepare Release Note during code delivery.

Note: I am talking only about Windows environment here.

Excel 2003 tips

Some Excel 2003 tips I would like to share –

Insert/Delete a new row/column Select a row by clicking on the number/alphabet on the grid panel and Ctrl + or Ctrl – Compare with “Right Click -> Insert… -> Select an option in the dialog”, Or doing it from menu.
Shift selected cells to adjacent row/column Select some cells of a row and Ctrl + or Ctrl – Provides the option to shift the selected cells up or down or to insert a row.
Compare with “Right Click -> Insert… -> Select an option in the dialog.”
Paste contents from row immediately above Select the entire row or cells and Ctrl D (Down) Most of the times, you have to repeat the same content in the next row – instead of Ctrl C – Ctrl V, you can simply use Ctrl D
Paste contents from column to right column Select the entire column or cells and Ctrl R (Right) Most of the times, you have to repeat the same content in the next row – instead of Ctrl C – Ctrl V, you can simply use Ctrl D
To put current date Ctrl ; Imagine the scenario of updating Close/Start/End date in a Issue/Defects tracker for multiple items.
In addition, automatically formats value to the Date format (ex: mm/dd/yyyy) used in the column
To get a dropdown of values already present in the column (Auto-suggest) Alt DownArrow Image the scenario of updating an ‘Issue Owner’ column for some 10 rows have your 5 team members. If the first letter is unique, typing first letter will auto suggest. Otherwise, you have to type as long as the first unique set of characters.
To get the dropdown of list of possible values Alt UpArrow In most scenarios, you have a list of possible values define like ‘Yes;No;NA’ – Either you have to type No/NA or use mouse to open the dropdown to select a value.
Now, simply use Alt UpArrow and choose using arrows.
Redo F4 In general, this is not used as regular as Ctrl-Z unless you have used undo more than required. 🙂

This can be used wisely in many cases –
1. To insert multiple rows between two rows: Press (Ctrl + ) for inserting first row, and then repeat using F4 for remaining rows.
2. Need to highlight/change font color/make bold/set background color for a cell – Do it for the first time and use F4 repeatedly.

To print/Print preview/change Page setup like Header/footer/margins for multiple sheets in the workbook Select the sheets using Ctrl+Click – then go to File menu and change the settings. This looks obvious, but it took me 2 years to find the way 😦

Some trivial shortcuts, in case you are new to excel:
– Ctrl + Page Up/Page Down to navigate sheets
– Alt + Enter to have line break (multiple paras) in a cell
– F2 to edit a cell

p.s. I am a lazy person and have aversion to mouse – so, I always look to make efficient use of KB

Web Marketing

These are my thoughts after reading a blog-friend, Veera’s post on his external site about adsense .

Google Adsense and other similar intelligent internet advertising programs process and analyze the content of the webpage being displayed and generate the ads to be displayed. But, as Veera pointed out, readers who know about Adsense do not click on these ads. We do everything to avoid ads – keeping pop-up blockers.

I feel that the web marketing still has a large potential to expand. The companies can tie up with major web-sites and blog sites of popular personalities from films and sportspersons. At present, as far as I know, the films deal only with internet media partnerships and brand tie-ups. The internet media partnership only looks into the tie-up between producer and an internet portal like sify.com or bigadda.com for the film’s promotion. Similarly, the brand tie-ups involve interleaving promotion of a market brand within the script of a movie – for example, Aamir Khan drinking Coca Cola throughout a movie.

But, how does it look if there is a full-size image of Aamir Khan drinking a Coca Cola as a permanent left side banner on his web-site (www.aamirkhan.com). Likewise, a thumbnail picture of Coke bottle could be put at the start of each paragraph on the article, like a bullet. The person reading the blog may feel to drink the coke after visiting the site. This is not as obtrusive as pop-ups and user need not click on anything. The company can pay the site owner based on the number of web-site hits and not on ad-clicks.

If the soft drink companies could reach out marriage invitational flexi-boards in remote villages, why they are ignoring such popular spaces on the internet for ads.

Now another question that may arise is how does such strategy help normal bloggers like me, who are not stars but starters who have to build up viewership. The companies can tie-up with blog sites like blogger and wordpress to insert their advertisements in blog templates and let the blogger choose one or more of the companies to display on his/her blog. The blogger can paid based on the count of web-site hits or trackbacks and the blog site can charge the company either based on the number of bloggers or a fixed contract value.

Any blogger will be happy to put the company logos and product ads of his/her liking than to depend on some randomly-generated ad, which on most of occasions is totally unrelated to the blog content or to the readers.

I am not sure if such marketing strategy is already in place, at least I do not see it. Perhaps, it may not be popular or I might not have observed carefully. If such idea is not in place, I believe this idea is worth to be evaluated by the companies.

Gridview and extra Div

Disclaimer: This post is to share info for people working on ASP.Net. There is no intention to defame or pass comments/remarks or criticize any person or organization.

M$ did it again!

I have code working witin ASP-HTML-Javascript that dynamically shows a vertical scrollbar when the no. of rows exceed a configurable value.

<body onload=fnSetTableHeigh() >
<table id=tblDetails >
<— Table rows >

This has been working without any issues in my ASP. Recently, I have added a new ASPX web page to the ASP.Net section of our application.

So, a GridView control is defined to display the data and I have used the same concept. GridView control should render a HTML table and so I enclosed it in a DIV expecting it to work –

<div id=divDetails>
<asp:GridView id=gvDetails >


But, it was not working. I thought it was an issue with my JS and tried to fix that function. No progress. Then, I tried to adjust various attributes of the gridview and div controls – but in vain.

After struggling for 2 hours, somehow I thought I should see what was getting rendered actually. To my horror, gridview is rendering extra div; The rendered code was –

<div id=divDetails>
<table id=tblDetails >
<— Table rows >

This was OK until I saw the response on the site when this bug had been reported in 2006! They did not bother to fix this even in VS 2008, ASP.Net 3.5.


For umpteenth time, I thought of banging my head for choosing MS technologies as my stream.